(1) Field of the Invention
The present invention relates to a secondary storage device using nonvolatile semiconductor memory, and more particularly, to a secondary storage device using flash memory which permits rewriting of data on a block area-by-block area basis and which is provided with spare block areas.
(2) Description of the Related Art
Many of present-day small computers use a hard disk unit as a secondary storage device, but since the hard disk unit includes mechanical parts, it has a short service life, requires maintenance, and must be used under narrow environmental conditions (temperature, humidity, vibration) as compared with semiconductor memories. Secondary storage devices using flash memory are therefore expected much as an alternative to that using a hard disk unit.
Usually, a flash memory for use in a secondary storage device in place of a hard disk has a storage area thereof divided into a plurality of block areas (several tens of kilobytes each), and although data can be written on a byte-by-byte or word-by-word basis, data is erased on a block-by-block basis. A block becomes incapable of data writing or erasure after repeated writing and erasure operations, and at this point of time the life of the block comes to an end.
Conventional flash memory has a limitation (lifetime) on the number of repetitions of erasure, and therefore, to prolong the service life as a secondary storage device, the flash memory is provided with spare blocks equal to or greater than the number of active blocks so that spare blocks may be used in place of those blocks which are no longer capable of rewriting operations due to expiration of the block'life.
FIGS. 18(A) to 18(C) show the arrangement of blocks in a conventional flash memory. In FIGS. 18(A), 18(B) and 18(C) is illustrated, in that order, how block areas change with time. The flash memory is constituted by (n+m) block areas to which are respectively assigned the physical numbers 1 to (n+m), for example, and among these block areas, n block areas with the physical numbers 1 to n are active block areas while the remaining m block areas are spare block areas. The active block areas store respective pieces of information to which are assigned the logical numbers 1 to n (FIG. 18(A)).
Provided that the information with the logical number 2, for example, is to be updated, the block area with the physical number 2, in which the information with the logical number 2 has been stored until then, is checked as to the number of times erasure operations were performed. If, as a result, the count of erasure operations does not exceed a limit (e.g., 100,000 times), update information is written into the block area with the physical number 2. However, if the limit is exceeded, the block area with the physical number 2 is regarded as unusable any longer; therefore, the block area with the physical number (n+1) is newly assigned as a block for storing the information with the logical number 2 and an update for the information with the logical number 2 is written into this block (FIG. 18(B)).
A write operation like this is repeated, and when no further spare block areas are available (FIG. 18(C)), it is judged that the life of the flash memory has come to an end.
In conventional devices, however, if the information with the logical number 1, for example, is a kind of information that is scarcely altered once it is stored, it is very likely that the block area with the physical number 1 has undergone an erase operation only several times, leaving a considerable number of times an erase operation can be executed until the limit of service life is reached. Nevertheless, the service life of the flash memory is regarded as having expired as soon as all the spare blocks are used.
The limit to the number of repetitions of erase operation of flash memory includes a minimum value and an average value, which ordinarily differ from each other by about ten times. The minimum value is a guaranteed limit up to which individual block areas can be used with reliability, while the average value is based on actual data about how many times individual block areas can be subjected to erase operation before they become unusable. In general, the average value is approximately 1,000,000 times, as contrasted with the minimum value of 100,000 times.
The minimum value is conventionally adopted as the limit, and accordingly, even if the count of erase operations has reached the limit of 100,000 times, it does not necessarily mean that the block area immediately becomes unusable. A problem therefore arises in that, although in view of the average value erase operation can be repeated thereafter about 900,000 times, the use of the block area is stopped.